<?php

namespace App\Exports;

use App\Models\LoginLog;
use Illuminate\Contracts\View\View;
use Illuminate\Http\Request;
use Maatwebsite\Excel\Concerns\FromView;
use Maatwebsite\Excel\Concerns\ShouldAutoSize;

class LoginExport implements FromView,ShouldAutoSize
{
    public $login;

    public function __construct(Request $request)
    {
        $this->login = LoginLog::with('user')->pimp()->get();
    }

    /**
     * @return View
     */
    public function view(): View
    {
        return view('exports.login',[
            'login' => $this->login
        ]);
    }
}
